package com.y7net.snakeplus;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Bubble implements Serializable {

	private static final long serialVersionUID = -9074416814104340604L;

	public int randomRange = 1;
	public int randomValue = 2;
	public long removeDelay = 10000;
	
	public List<String> msgs;
	
	public Bubble(int randomRange, int randomValue, long removeDelay, String[] msgs) {
		this.randomRange = randomRange;
		this.randomValue = randomValue;
		this.removeDelay = removeDelay;
		if(msgs!=null){
			this.msgs = new ArrayList<String>();
			for(int i=0; i<msgs.length; i++){
				this.msgs.add(msgs[i]);
			}
		}
	}
	
	public Bubble clone(){
		String[] mymsgs = null;
		if(this.msgs!=null && this.msgs.size()>0){
			int len = this.msgs.size();
			mymsgs = new String[len];
			for(int i=0; i<len; i++){
				mymsgs[i] = this.msgs.get(i);
			}
		}
		return new Bubble(this.randomRange,this.randomValue,this.removeDelay, mymsgs);
	}

}
